﻿using CrystalDecisions.CrystalReports.Engine;
using DSPL.Reports.ReportBase.Stock.Master;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DSPL.Reports.ReportBase;


namespace DSPL.Reports.Classes.Category
{
    class StockMasterReports:CategoryReports
    {
        public StockMasterReports(string reportId)
        {
            this.documentId = reportId;
        }

        #region Report Category Members
        public override ReportDocument GetReportDocument(DataTable reportDataTable= null)
        {
            try
            {
                reportDoc = new ReportDocument();

                switch (documentId)
                {
                    case "rptAreaMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptAreaMaster());
                        else
                            return GetFilledReport(new rptAreaMaster(), reportDataTable);

                    case "rptSupplierGroupMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptSupplierGroupMaster());
                        else
                            return GetFilledReport(new rptSupplierGroupMaster(), reportDataTable);

                    case "rptLocationMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptLocationMaster());
                        else
                            return GetFilledReport(new rptLocationMaster(), reportDataTable);

                    case "rptCardTypeMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptCardTypeMaster());
                        else
                            return GetFilledReport(new rptCardTypeMaster(), reportDataTable);

                    case "rptCustomerGroupMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptCustomerGroupMaster());
                        else
                            return GetFilledReport(new rptCustomerGroupMaster(), reportDataTable);

                    case "rptProductGroupMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptProductGroupMaster());
                        else
                            return GetFilledReport(new rptProductGroupMaster(), reportDataTable);

                    case "rptProductTypeMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptProductTypeMaster());
                        else
                            return GetFilledReport(new rptProductTypeMaster(), reportDataTable);

                    case "rptUnitMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptUnitMaster());
                        else
                            return GetFilledReport(new rptUnitMaster(), reportDataTable);

                    case "rptReasonMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptReasonMaster());
                        else
                            return GetFilledReport(new rptReasonMaster(), reportDataTable);

                    case "rptRankMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptRankMaster());
                        else
                            return GetFilledReport(new rptRankMaster(), reportDataTable);

                    case "rptSalesRepMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptSalesRepMaster());
                        else
                            return GetFilledReport(new rptSalesRepMaster(), reportDataTable);
                    
                    case "rptSupplierMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptSupplierMaster());
                        else
                            return GetFilledReport(new rptSupplierMaster(), reportDataTable);

                    case "rptProductMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptProductMaster());
                        else
                            return GetFilledReport(new rptProductMaster(), reportDataTable);

                    case "rptDebtorMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptDebtorMaster());
                        else
                            return GetFilledReport(new rptDebtorMaster(), reportDataTable);

                    case "rptTaxMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptTaxMaster());
                        else
                            return GetFilledReport(new rptTaxMaster(), reportDataTable); 

                    case "rptCurrencyMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptCurrencyMaster());
                        else
                            return GetFilledReport(new rptCurrencyMaster(), reportDataTable);


                    case "rptPriceLevelMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptPriceLevelMaster());
                        else
                            return GetFilledReport(new rptPriceLevelMaster(), reportDataTable);

                    case "rptTaxCombinationMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptTaxCombinationMaster());
                        else
                            return GetFilledReport(new rptTaxCombinationMaster(), reportDataTable);


                    case "rptCostCentreMaster":
                        if (reportDataTable == null)
                            return GetFilledReport(new rptCostCentreMaster());
                        else
                            return GetFilledReport(new rptCostCentreMaster(), reportDataTable);  

                    default:
                        break;
                }
                return null;
            }
            catch (Exception)
            {
                throw;
            }
        }
        #endregion
    }
}
